DATA SEGMENT ;此处输入数据段代码  
INFO1   DB   0DH,0AH,'INPUT A NUMBER:$'
INFO2   DB   0DH,0AH,'THE DECIMAL OF THIS NUMBER IS:$'
INFO3   DB   0DH,0AH,'THE HEXIMAL OF THIS NUMBER IS:$'
INFO4   DB   0DH,0AH,'THE QECIMAL OF THIS NUMBER IS:$'
INFO5   DB   0DH,0AH,'THE BINIMAL OF THIS NUMBER IS:$'
DATA ENDS

ZHUANHUA SEGMENT
ASSUME CS:ZHUANHUA,DS:DATA
MAIN PROC FAR 
MOV AX,DATA
MOV DS,AX
REPET:
       CALL DECIBIN    ;十进制转化到二进制，输入函数   
       JMP REPET 
MAIN ENDP
DECIBIN PROC NEAR      ;十进制转化到二进制函数
        LEA  DX,INFO1
        MOV  AH,09H           
        INT  21H     
        MOV BX,0
NEWCHAR:MOV AH,01H
        INT 21H
        SUB AL,30H
        JL EXIT
        CMP AL,9D
        JG EXIT
        CBW 
        XCHG AX,BX
        MOV CX,10D
        MUL CX
        XCHG AX,BX
        ADD BX,AX
        JMP NEWCHAR
EXIT: 
        RET
DECIBIN ENDP

ZHUANHUA    ENDS
  END MAIN
